﻿using System;
using System.Threading.Channels;

namespace Csharp2048
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello, World!");
            while (true) 
            {

                Console.Write("输入阶数: ");
                int n=int.Parse(Console.ReadLine());
                Game2048 game = new Game2048(n);

                
                while(true)
                {
                    Console.Clear();
                    game.RandomAddNum();
                    game.PrintBoard();
                    var move_list = game.GetMoveList();
                    foreach (var move in move_list)
                    {
                        Console.WriteLine(move);
                    }
                    
                    //game.PrintBoardBool();
                    game.Merge(KeyboardInteraction.WaitForKeyPress());
                    
                }
                
            }
            
        }
    }
}
